# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ReplicaPool.V1beta1.Model.VmParams do
  @moduledoc """
  Parameters for creating a Compute Engine Instance resource. Most fields are identical to the corresponding Compute Engine resource.

  ## Attributes

  *   `baseInstanceName` (*type:* `String.t`, *default:* `nil`) - Deprecated. Please use baseInstanceName instead.
  *   `canIpForward` (*type:* `boolean()`, *default:* `nil`) - Enables IP Forwarding, which allows this instance to receive packets destined for a different IP address, and send packets with a different source IP. See IP Forwarding for more information.
  *   `description` (*type:* `String.t`, *default:* `nil`) - An optional textual description of the instance.
  *   `disksToAttach` (*type:* `list(GoogleApi.ReplicaPool.V1beta1.Model.ExistingDisk.t)`, *default:* `nil`) - A list of existing Persistent Disk resources to attach to each replica in the pool. Each disk will be attached in read-only mode to every replica.
  *   `disksToCreate` (*type:* `list(GoogleApi.ReplicaPool.V1beta1.Model.NewDisk.t)`, *default:* `nil`) - A list of Disk resources to create and attach to each Replica in the Pool. Currently, you can only define one disk and it must be a root persistent disk. Note that Replica Pool will create a root persistent disk for each replica.
  *   `machineType` (*type:* `String.t`, *default:* `nil`) - The machine type for this instance. The resource name (e.g. n1-standard-1).
  *   `metadata` (*type:* `GoogleApi.ReplicaPool.V1beta1.Model.Metadata.t`, *default:* `nil`) - The metadata key/value pairs assigned to this instance.
  *   `networkInterfaces` (*type:* `list(GoogleApi.ReplicaPool.V1beta1.Model.NetworkInterface.t)`, *default:* `nil`) - A list of network interfaces for the instance. Currently only one interface is supported by Google Compute Engine, ONE_TO_ONE_NAT.
  *   `onHostMaintenance` (*type:* `String.t`, *default:* `nil`) - 
  *   `serviceAccounts` (*type:* `list(GoogleApi.ReplicaPool.V1beta1.Model.ServiceAccount.t)`, *default:* `nil`) - A list of Service Accounts to enable for this instance.
  *   `tags` (*type:* `GoogleApi.ReplicaPool.V1beta1.Model.Tag.t`, *default:* `nil`) - A list of tags to apply to the Google Compute Engine instance to identify resources.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :baseInstanceName => String.t(),
          :canIpForward => boolean(),
          :description => String.t(),
          :disksToAttach => list(GoogleApi.ReplicaPool.V1beta1.Model.ExistingDisk.t()),
          :disksToCreate => list(GoogleApi.ReplicaPool.V1beta1.Model.NewDisk.t()),
          :machineType => String.t(),
          :metadata => GoogleApi.ReplicaPool.V1beta1.Model.Metadata.t(),
          :networkInterfaces => list(GoogleApi.ReplicaPool.V1beta1.Model.NetworkInterface.t()),
          :onHostMaintenance => String.t(),
          :serviceAccounts => list(GoogleApi.ReplicaPool.V1beta1.Model.ServiceAccount.t()),
          :tags => GoogleApi.ReplicaPool.V1beta1.Model.Tag.t()
        }

  field(:baseInstanceName)
  field(:canIpForward)
  field(:description)
  field(:disksToAttach, as: GoogleApi.ReplicaPool.V1beta1.Model.ExistingDisk, type: :list)
  field(:disksToCreate, as: GoogleApi.ReplicaPool.V1beta1.Model.NewDisk, type: :list)
  field(:machineType)
  field(:metadata, as: GoogleApi.ReplicaPool.V1beta1.Model.Metadata)
  field(:networkInterfaces, as: GoogleApi.ReplicaPool.V1beta1.Model.NetworkInterface, type: :list)
  field(:onHostMaintenance)
  field(:serviceAccounts, as: GoogleApi.ReplicaPool.V1beta1.Model.ServiceAccount, type: :list)
  field(:tags, as: GoogleApi.ReplicaPool.V1beta1.Model.Tag)
end

defimpl Poison.Decoder, for: GoogleApi.ReplicaPool.V1beta1.Model.VmParams do
  def decode(value, options) do
    GoogleApi.ReplicaPool.V1beta1.Model.VmParams.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ReplicaPool.V1beta1.Model.VmParams do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
